/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.gitee.wsl.db.dsl.query

/**
 * @author Administrator
 */
class QBFParameters  {
    private val andList: MutableList<QBFParameter> = mutableListOf<QBFParameter>()
    private val orList: MutableList<QBFParameter> = mutableListOf<QBFParameter>()

    private val andSubList: MutableList<QBFParameters> = mutableListOf<QBFParameters>()
    private val orSubList: MutableList<QBFParameters> = mutableListOf<QBFParameters>()

    constructor()

    constructor(para: QBFParameter?) {
        if (para != null) andList.add(para)
    }


    fun and(para: QBFParameter): QBFParameters {
        andList.add(para)
        return this
    }

    fun or(para: QBFParameter): QBFParameters {
        orList.add(para)
        return this
    }

    fun and(para: QBFParameters): QBFParameters {
        andSubList.add(para)
        return this
    }

    fun or(para: QBFParameters): QBFParameters {
        orSubList.add(para)
        return this
    }

    fun getAndList(): List<QBFParameter> {
        return andList
    }

    fun getOrList(): List<QBFParameter> {
        return orList
    }

    fun getAndSubList(): List<QBFParameters> {
        return andSubList
    }

    fun getOrSubList(): List<QBFParameters> {
        return orSubList
    }


    companion object {
        var LINKTYPE_And: Int = 0
        var LINKTYPE_Or: Int = 1
    }
}
